package com.naire.modul.sys_code.action;

import java.util.ArrayList;
import java.util.List;

import net.common.action.GeneralAction;
import net.common.manager.SystemCodeManager;

import com.naire.modul.sys_code.service.Sys_codeDeleteService;
import com.naire.modul.sys_code.service.Sys_codeEditorService;
import com.naire.modul.sys_code.vo.Sys_codeVo;

public class Sys_codeAction extends GeneralAction {

	private static final long serialVersionUID = 7127573666355745443L;

	private Sys_codeVo bean = new Sys_codeVo();
	private List<Sys_codeVo> list = new ArrayList<Sys_codeVo>();
	
	public String search() throws Exception {
		list.addAll(SystemCodeManager.getList());
		return SUCCESS;
	}
	
	public String editor() throws Exception {
		Sys_codeEditorService service = new Sys_codeEditorService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public String find() throws Exception {
		bean = SystemCodeManager.get(bean.getCode_num());
		return SUCCESS;
	}
	
	public String delete() throws Exception {
		Sys_codeDeleteService service = new Sys_codeDeleteService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public Sys_codeVo getBean() {
		return bean;
	}
	public void setBean(Sys_codeVo bean) {
		this.bean = bean;
	}
	public List<Sys_codeVo> getList() {
		return list;
	}
	public void setList(List<Sys_codeVo> list) {
		this.list = list;
	}
}
